package com.zhang.family_doctor.mapper;

import com.zhang.family_doctor.entity.ApplyJoinTeam;
import com.zhang.family_doctor.entity.Doctor;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ApplyJoinTeamMapper {

    /**
     * 申请加入团队
     * @param applyJoinTeam
     */
    void applyToJoinTeam(ApplyJoinTeam applyJoinTeam);

    /**
     * 修改申请状态
     * @param applyJoinTeam
     */
    void updateById(ApplyJoinTeam applyJoinTeam);

    /**
     * 查询是否有提交过申请
     * @param doctorId
     * @param teamId
     * @return
     */
    ApplyJoinTeam getApplyJoinTeamByDoctorIdAndTeamIdOne(@Param("doctorId") Integer doctorId, @Param("teamId") Integer teamId);

    /**
     * 根据团队id和医生id修改状态
     * @param teamId
     * @param doctorId
     */
    void updateByTeamIdAndDoctorId(@Param("teamId") Integer teamId, @Param("doctorId") Integer doctorId);

    /**
     * 根据医生id和团队id查询已经退出的
     * @param doctorId
     * @param teamId
     * @return
     */
    ApplyJoinTeam getApplyJoinTeamByDoctorIdAndTeamIdTwo(@Param("doctorId") Integer doctorId, @Param("teamId") Integer teamId);

    /**
     * 根据医生id和团队id查询被拒绝的
     * @param doctorId
     * @param teamId
     * @return
     */
    ApplyJoinTeam getApplyJoinTeamByDoctorIdAndTeamIdThree(@Param("doctorId") Integer doctorId, @Param("teamId") Integer teamId);

    /**
     * 根据医生id和团队id删除申请表的数据
     * @param doctorId
     * @param teamId
     */
    void delete(@Param("doctorId") Integer doctorId,@Param("teamId") Integer teamId);

    /**
     * 根据团队id查询申请的医生
     * @param teamId
     * @return
     */
    List<Doctor> selectApplyJoinTeamByTeamId(Integer teamId);
}